package com.kyyc.luff.testb.fegin.factory;

import com.kyyc.luff.testb.fegin.RemoteTestaService;
import com.kyyc.luff.testb.fegin.fallback.RemoteTestaServiceFallback;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class RemoteTestaServiceFallbackFactory implements FallbackFactory<RemoteTestaService> {

	@Override
	public RemoteTestaService create(Throwable throwable) {
        RemoteTestaServiceFallback remoteTestaServiceFallback = new RemoteTestaServiceFallback();
        remoteTestaServiceFallback.setCause(throwable);
		return remoteTestaServiceFallback;
	}
}
